package be.jabapage.gui;

import java.awt.Dimension;

import javax.swing.ButtonGroup;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.border.BevelBorder;

import be.jabapage.gui.actions.*;
import be.jabapage.gui.actions.bond.NewBondAction;
import be.jabapage.gui.actions.bond.SearchBondAction;
import be.jabapage.gui.actions.league.SearchLeagueAction;
import be.jabapage.util.PropertiesSingleton;

public class SnookerMenuBar extends JMenuBar {

	JFrame frame;
	JDesktopPane desk;
	PropertiesSingleton messages = PropertiesSingleton.getInstance();
	public SnookerMenuBar(JFrame frame) {
		super();
		this.frame = frame;
		this.setBorder(new BevelBorder(BevelBorder.RAISED));
		this.desk = (JDesktopPane) frame.getContentPane();
		// file menu
		JMenu fileMenu = new JMenu(messages.getString("menu.file"));
		this.add(fileMenu);
		JMenuItem exitItem = new JMenuItem(new ExitAction(frame));
		fileMenu.add(exitItem);
		
		// search menu
		JMenu searchMenu = new JMenu(messages.getString("menu.search"));
		this.add(searchMenu);
		JMenuItem searchBondWindowItem = new JMenuItem(new SearchBondAction(frame));
		searchMenu.add(searchBondWindowItem);
		JMenuItem searchLeagueWindowItem = new JMenuItem(new SearchLeagueAction(frame));
		searchMenu.add(searchLeagueWindowItem);
		// Settings menu
		JMenu settingsMenu = new JMenu(messages.getString("menu.settings"));
		this.add(settingsMenu);
		JMenu resolution = new JMenu(messages.getString("menu.resolution"));
		settingsMenu.add(resolution);
		ButtonGroup buttonGroup = new ButtonGroup();
		JRadioButtonMenuItem item = new JRadioButtonMenuItem(new ResolutionAction(frame,new Dimension(1024,800)));
		item.setSelected(true);
		JRadioButtonMenuItem item2 = new JRadioButtonMenuItem(new ResolutionAction(frame,new Dimension(800,600)));
		buttonGroup.add(item);
		buttonGroup.add(item2);
		resolution.add(item);
		resolution.add(item2);
		
		
	}
}
